import { httpGet, httpPost, httpDelete, httpPut } from '@/http'
import { services } from '@/config'

/**
 * 加载采购列表明细集合
 * @param parentId 采购id
 */
export const getPurchaseOrderList = parentId =>
  httpGet(`${services.assetService}fyassetpurchaseorderlist/getPurchaseOrderList/${parentId}`)

export const delPurchaseOrderListObj = ids =>
  httpGet(`${services.assetService}fyassetpurchaseorderlist/delPurchaseOrderList`, { ids })

export const fetchList = params => httpGet(`${services.assetService}fyassetpurchaseorderlist/page`, params)

export const addObj = data => httpPost(`${services.assetService}fyassetpurchaseorderlist`, data)

export const getObj = id => httpGet(`${services.assetService}fyassetpurchaseorderlist/${id}`)

export const delObj = id => httpDelete(`${services.assetService}fyassetpurchaseorderlist/${id}`)

export const putObj = data => httpPut(`${services.assetService}fyassetpurchaseorderlist`, data)
